package com.justgame.project.service.online.controller;

import com.justgame.project.cloud.common.constant.Result;
import com.justgame.project.service.api.dto.OnlineVipDTO;
import com.justgame.project.service.online.service.OnlineVipService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/online/vip")
@AllArgsConstructor
public class OnlineVipController {

    private final OnlineVipService vipService;

//    /**
//     * 支付成为会员
//     * @return
//     */
//    @PostMapping("pay")
//    public Result<?> pay(){
//        return Result.status(vipService.handleVipService());
//    }

    /**
     * 获取支付跳转链接
     */
    @GetMapping("pay-url")
    public Result<?> getPayUrl(OnlineVipDTO dto, HttpServletRequest request){
        return Result.OK(vipService.handleVipService(dto,request));
    }

    /**
     * 获取支付跳转链接
     */
    @GetMapping("vip-server-show")
    public Result<?> getVipServerShow(){
        return Result.OK(vipService.getVipServerShow());
    }
}
